]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: fix early destroy of SystemBackground
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 26 Jun 2014 16:45:06 +0000 (18:45 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 26 Jun 2014 17:20:17 +0000 (19:20 +0200)
If the SystemBackground is destroyed before loading, we call
removeImageContent() with null, which crashes.

js/ui/background.js

index 3730beb3a1490e8bc01f31631f26e72c1fcbcb7a..021269989e62d12c37fee18130f6fb4abfadfd0e 100644 (file)
@@ -659,7 +659,10 @@ const SystemBackground = new Lang.Class({
     },
 
     _onDestroy: function() {
-        this._cache.removeImageContent(this.actor.content);
+        let content = this.actor.content;
+
+        if (content)
+            this._cache.removeImageContent(content);
     },
 });
 Signals.addSignalMethods(SystemBackground.prototype);